<template>
  <div class="playMusic">
    <div class="geci"></div>
    <div class="audio">
      <audio ref="audio"></audio>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 播放器图片
      picUrl: "",
      // 歌曲名字
      name: null,
      // 副标题
      alias: null,
      // 歌手
      artName: [],
    };
  },
  mounted() {
    let _this = this;
    this.$bus.$on("get-src", function (data) {
      setTimeout(function () {
        _this.$refs.audio.src = data.url;
        _this.picUrl = data.picUrl;
        _this.name = data.name;
        _this.alias = data.alias;
        _this.artName = data.arts;
      });
      console.log(this.name);
    });
  },
};
</script>

<style scoped>
@import url("../css/playMusic");
</style>